<%@ page import="dao.CommDAO" pageEncoding="UTF-8" %>
<%@page import="util.Info" %>
<%@page import="java.util.HashMap" %>
<%@page import="java.util.List" %>

<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<%
    CommDAO dao = new CommDAO();
    if (request.getParameter("z") != null) session.invalidate();
    int tsize = 35;
    int starsize = 7;
%>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="News - Clean HTML5 and CSS3 responsive template">
    <meta name="author" content="MyPassion">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>News - Responsive HTML5 and CSS3 </title>

    <link rel="shortcut icon" href="img/sms-4.ico"/>

    <!-- STYLES -->
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/superfish.css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/fontello/fontello.css"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/flexslider.css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/ui.css"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/960.css"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/devices/1000.css"
          media="only screen and (min-width: 768px) and (max-width: 1000px)"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/devices/767.css"
          media="only screen and (min-width: 480px) and (max-width: 767px)"/>
    <link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/devices/479.css"
          media="only screen and (min-width: 200px) and (max-width: 479px)"/>

    <!--[if lt IE 9]>
    <script type="text/javascript" src="/wallpaper/frontfiles/js/customM.js"></script> <![endif]-->


</head>

<body>

<!-- Body Wrapper -->
<div class="body-wrapper">
    <div class="controller">
        <div class="controller2">
            <jsp:include page="top.jsp"></jsp:include>

            <!-- Content -->
            <section id="content">
                <div class="container">
                    <!-- Main Content -->
                    <div class="main-content">

                        <%
                            List<HashMap> splist = new CommDAO().select("select * from resources where stype='自然风光' order by id desc", 1, 5);
                        %>

                        <!-- Popular News -->
                        <div class="column-one-third">
                            <h5 class="line"><span>自然风光.</span></h5>
                            <div class="outertight">
                                <ul class="block">

                                    <%
                                        for (HashMap m : splist) {
                                            String stars = m.get("stars").toString();
                                            int tsize_copy = tsize;
                                            if (stars.equals("")) tsize_copy += starsize;
                                            int titlesize = m.get("title").toString().length();
                                            int lastsize = tsize_copy - titlesize;
                                    %>
                                    <li>
                                        <a href="resourcex.jsp?id=<%=m.get("id")%>"><img
                                                src="/wallpaper/upfile/<%=m.get("filename") %>" alt="MyPassion"
                                                class="alignleft" width="200" height="120"/></a>
                                        <p>
                                            <span><%=m.get("savetime") %></span>
                                            <a href="resourcex.jsp?id=<%=m.get("id")%>"><font
                                                    color=black><%=Info.ensubStr(m.get("title"), 40)  %>
                                            </font></a>
                                            ,
                                            <a href="resourcex.jsp?id=<%=m.get("id")%>"><font
                                                    color="#8A8A8C"><%=Info.ensubStr(m.get("content"), lastsize)  %>
                                            </font></a>
                                        </p>
                                        <span class="rating">
                                    <span style="width:80%;">
                                    <%
                                        if (!stars.equals("")) {
                                    %>
                                    <img src="/wallpaper/frontfiles/img/star<%=stars %>.png" alt="MyPassion" width="60"
                                         height="13"/>
                                    <%} %>
                                    </span></span>
                                    </li>
                                    <%} %>
                                </ul>
                            </div>
                        </div>
                        <!-- /Popular News -->

                        <%
                            List<HashMap> zllist = new CommDAO().select("select * from resources where stype='社会人文' order by id desc", 1, 5);
                        %>
                        <!-- Popular News -->
                        <div class="column-one-third">
                            <h5 class="line"><span>社会人文.</span></h5>
                            <div class="outertight">
                                <ul class="block">
                                    <%
                                        for (HashMap m : zllist) {
                                            String stars = m.get("stars").toString();
                                            int tsize_copy = tsize;
                                            if (stars.equals("")) tsize_copy += starsize;
                                            int titlesize = m.get("title").toString().length();
                                            int lastsize = tsize_copy - titlesize;
                                    %>
                                    <li>
                                        <a href="resourcex.jsp?id=<%=m.get("id")%>"><img
                                                src="/wallpaper/upfile/<%=m.get("filename") %>" alt="MyPassion"
                                                class="alignleft" width="200" height="120"/></a>
                                        <p>
                                            <span><%=m.get("savetime") %></span>
                                            <a href="resourcex.jsp?id=<%=m.get("id")%>"><span
                                                    style="color: black; "><%=Info.ensubStr(m.get("title"), 40)  %>
                                            </span></a>
                                            ,
                                            <a href="resourcex.jsp?id=<%=m.get("id")%>"><span
                                                    style="color: #8A8A8C; "><%=Info.ensubStr(m.get("content"), lastsize)  %>
                                            </span></a>
                                        </p>
                                        <span class="rating"><span style="width:80%;">
                                     <%
                                         if (!stars.equals("")) {
                                     %>
                                    <img src="/wallpaper/frontfiles/img/star<%=stars %>.png" alt="MyPassion" width="60"
                                         height="13"/>
                                    <%} %>
                                    </span></span>
                                    </li>
                                    <%} %>
                                </ul>
                            </div>
                        </div>
                        <!-- /Popular News -->

                        <%
                            List<HashMap> zslist = new CommDAO().select("select * from resources where stype='艺术作品' order by id desc", 1, 5);
                        %>
                        <!-- Hot News -->
                        <div class="column-one-third">
                            <h5 class="line"><span>艺术作品.</span></h5>
                            <div class="outertight m-r-no">
                                <ul class="block">
                                    <%
                                        for (HashMap m : zslist) {
                                            String stars = m.get("stars").toString();
                                            int tsize_copy = tsize;
                                            if (stars.equals("")) tsize_copy += starsize;
                                            int titlesize = m.get("title").toString().length();
                                            int lastsize = tsize_copy - titlesize;
                                    %>
                                    <li>
                                        <a href="resourcex.jsp?id=<%=m.get("id")%>"><img
                                                src="/wallpaper/upfile/<%=m.get("filename") %>" alt="MyPassion"
                                                class="alignleft" width="200" height="120"/></a>
                                        <p>
                                            <span><%=m.get("savetime") %></span>
                                            <a href="resourcex.jsp?id=<%=m.get("id")%>"><span
                                                    style="color: black; "><%=Info.ensubStr(m.get("title"), 40)  %>
                                            </span></a>
                                            ,
                                            <a href="resourcex.jsp?id=<%=m.get("id")%>"><span
                                                    style="color: #8A8A8C; "><%=Info.ensubStr(m.get("content"), lastsize)  %>
                                            </span></a>
                                        </p>
                                        <span class="rating"><span style="width:80%;">
                                     <%
                                         if (!stars.equals("")) {
                                     %>
                                    <img src="/wallpaper/frontfiles/img/star<%=stars %>.png" alt="MyPassion" width="60"
                                         height="13"/>
                                    <%} %>
                                    </span></span>
                                    </li>
                                    <%} %>
                                </ul>
                            </div>
                        </div>
                        <!-- /Hot News -->
                    </div>
                    <!-- /Main Content -->
                </div>
            </section>
            <!-- / Content -->
            <jsp:include page="foot.jsp"></jsp:include>
        </div>
    </div>
</div>
<!-- / Body Wrapper -->


<!-- SCRIPTS -->
<script type="text/javascript" src="frontfiles/js/jquery.js"></script>
<script type="text/javascript" src="frontfiles/js/easing.min.js"></script>
<script type="text/javascript" src="frontfiles/js/1.8.2.min.js"></script>
<script type="text/javascript" src="frontfiles/js/ui.js"></script>
<script type="text/javascript" src="frontfiles/js/carouFredSel.js"></script>
<script type="text/javascript" src="frontfiles/js/superfish.js"></script>
<script type="text/javascript" src="frontfiles/js/customM.js"></script>
<script type="text/javascript" src="frontfiles/js/flexslider-min.js"></script>
<script type="text/javascript" src="frontfiles/js/tweetable.js"></script>
<script type="text/javascript" src="frontfiles/js/timeago.js"></script>
<script type="text/javascript" src="frontfiles/js/jflickrfeed.min.js"></script>
<script type="text/javascript" src="frontfiles/js/mobilemenu.js"></script>

<!--[if lt IE 9]>
<script type="text/javascript" src="frontfiles/js/html5.js"></script> <![endif]-->
<script type="text/javascript" src="frontfiles/js/mypassion.js"></script>


</body>
</html>

 
            